--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 19f0fa77242cfdf2f3a05b1fc52cd4ad4ccdf68d
Parents : eefb1c8
Author : Mark Qvist <mark@unsigned.io>
Date : 2024-10-04T11:22:39+02:00
Don't try creating LXMF peer destination until identity is resolved. Fixes #19.
Changes
Diff
diff --git a/LXMF/LXMPeer.py b/LXMF/LXMPeer.py
index a0b61a5..0962b26 100644
--- a/LXMF/LXMPeer.py
+++ b/LXMF/LXMPeer.py
@@ -108,7 +108,10 @@ class LXMPeer:
self.router = router
self.destination_hash = destination_hash
self.identity = RNS.Identity.recall(destination_hash)
- self.destination = RNS.Destination(self.identity, RNS.Destination.OUT, RNS.Destination.SINGLE, APP_NAME, "propagation")
+ if self.identity != None:
+ self.destination = RNS.Destination(self.identity, RNS.Destination.OUT, RNS.Destination.SINGLE, APP_NAME, "propagation")
+ else:
+ RNS.log(f"Could not recall identity for LXMF propagation peer {RNS.prettyhexrep(self.destination_hash)}, will retry identity resolution on next sync", RNS.LOG_WARNING)
def sync(self):
RNS.log("Initiating LXMF Propagation Node sync with peer "+RNS.prettyhexrep(self.destination_hash), RNS.LOG_DEBUG)
@@ -126,9 +129,10 @@ class LXMPeer:
else:
if self.identity == None:
self.identity = RNS.Identity.recall(destination_hash)
- self.destination = RNS.Destination(self.identity, RNS.Destination.OUT, RNS.Destination.SINGLE, APP_NAME, "propagation")
+ if self.identity != None:
+ self.destination = RNS.Destination(self.identity, RNS.Destination.OUT, RNS.Destination.SINGLE, APP_NAME, "propagation")
- if self.identity != None:
+ if self.destination != None:
if len(self.unhandled_messages) > 0:
if self.state == LXMPeer.IDLE:
RNS.log("Establishing link for sync to peer "+RNS.prettyhexrep(self.destination_hash)+"...", RNS.LOG_DEBUG)
diff --git a/LXMF/_version.py b/LXMF/_version.py
index 6b27eee..86716a7 100644
--- a/LXMF/_version.py
+++ b/LXMF/_version.py
@@ -1 +1 @@
-__version__ = "0.5.4"
+__version__ = "0.5.5"
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────